package com.cinyi.cyds.base.service;

import java.util.List;

import javax.servlet.http.HttpSession;

import com.cinyi.cyds.base.bean.Role;
import com.cinyi.cyds.base.bean.SessionInfo;
import com.cinyi.cyds.base.bean.Tree;


/**
 * 角色业务逻辑
 * 
 * @author core-system-dev
 * 
 */
public interface RoleServiceI {

	/**
	 * 保存角色
	 * 
	 * @param role
	 * @throws Exception 
	 */
	public void add(Role role, SessionInfo sessionInfo) throws Exception;

	/**
	 * 获得角色
	 * 
	 * @param id
	 * @return
	 * @throws Exception 
	 */
	public Role get(String id) throws Exception;

	/**
	 * 编辑角色
	 * 
	 * @param role
	 * @throws Exception 
	 */
	public void edit(Role role) throws Exception;

	/**
	 * 获得角色treeGrid
	 * 
	 * @return
	 * @throws Exception 
	 */
	public List<Role> treeGrid(SessionInfo sessionInfo) throws Exception;

	/**
	 * 删除角色
	 * 
	 * @param id
	 * @throws Exception 
	 */
	public void delete(String id) throws Exception;

	/**
	 * 获得角色树(只能看到自己拥有的角色)
	 * 
	 * @return
	 * @throws Exception 
	 */
	public List<Tree> tree(SessionInfo sessionInfo) throws Exception;

	/**
	 * 获得角色树
	 * 
	 * @return
	 * @throws Exception 
	 */
	public List<Tree> allTree() throws Exception;

	/**
	 * 为角色授权
	 * 
	 * @param role
	 * @throws Exception 
	 */
	public void grant(Role role) throws Exception;
	
}
